package com.cloudfun.campusshare.common.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * Created by Huqin on 2019/12/11
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "设备订单信息")
public class DeviceOrderVO {

    @ApiModelProperty(value = "用户名")
    @Length(max = 20, message = "用户名过长，限制20个字")
    private String username;

    @ApiModelProperty(value = "用户手机号")
    private String userPhone;

    @ApiModelProperty(value = "设备识别码")
    @NotEmpty(message = "设备识别码不能为空")
    @Length(max = 40, message = "设备识别码过长，限制40个字")
    @JsonProperty("deviceId")
    private String imei;

    @ApiModelProperty(value = "订单类型。1：洗衣；2：干衣；3：洗鞋；4：吹风机；5：饮水机；6.热水器")
    @NotNull(message = "订单类型不能为空")
    @Range(min = 1, max = 6, message = "订单类型错误")
    private Integer orderType;

    @ApiModelProperty(value = "下单时间")
    //@NotNull(message = "下单时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date tradeTime;

    @ApiModelProperty(value = "订单价格")
    @NotNull(message = "订单价格不能为空")
    @Range(min = 0, max = 9_999, message = "订单价格错误")
    private Double price;

}
